package com.tenebrous.jestic.mapper.idao.framwork.meber.organ;

import com.tenebrous.jestic.entity.framwork.meber.organ.OrgUserGrant;
import com.tenebrous.jestic.mapper.ISuperMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

//@Mapper
public interface OrgUserGrantMapper extends ISuperMapper<OrgUserGrant> {

    @Select("SELECT * FROM ORG_USER_GRANT A WHERE A.USERID=#{userid} ORDER BY A.SORT")
    List<OrgUserGrant> selectByUserid(@Param("userid") String userid);

    @Select("SELECT * FROM ORG_USER_GRANT A WHERE A.USERID=#{userid} AND A.GRANT_TARGETID=#{targetid} ORDER BY A.SORT")
    OrgUserGrant selectByUseridAndTargetid(@Param("userid") String userid, @Param("targetid") String targetid);

    List<String> checkGrant(@Param("userid") String userid, @Param("targetids") String[] targetids);
}